from typing import List

class Solution:
    def productExceptSelf(self, nums: List[int]) -> List[int]:
        left = 1
        right = 1
        data = []
        for i in nums:
            data.append(left)
            left *= i

        for i in range(len(nums)-1, -1, -1):
            data[i] *= right
            right *= nums[i]
        return data

Solution().productExceptSelf([1,2,3,4])